<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<div id="page-content">
    <div class="row" style="margin-bottom:20px;">
        <div class="col-lg-6 col-sm-6 col-xs-12" id="notice_list" style="padding-right:25px">
            <div class="panel">
                <div class="panel-heading">
                    <h3 class="panel-title">公告通知测试</h3>
                    <div class="col-sm-12 table-toolbar-right" style="position: absolute; right: 15px;top: 16px;">
                        <a id="notice_more" class= btn-default" style="cursor:pointer;font-size: 16px">more</a>
                    </div>

                </div>
                <div class="panel-body" id="notice_list_row">
                    <table id="notice_table">
                    </table>
                </div>
            </div>
        </div>

        <div class="col-lg-6 col-sm-6 col-xs-12" id="remind_list" style="padding-left:25px">
            <div class="panel">
                <div class="panel-heading">
                    <h3 class="panel-title">提醒事项</h3>
                    <div class="col-sm-12 table-toolbar-right" style="position: absolute; right: 15px;top: 16px;">
                        <a  id="remind_more" class= btn-default" style="cursor:pointer;font-size: 16px">more</a>
                    </div>
                </div>
                <div class="panel-body"  id="remind_list_row">
                    <table id="remind_table" >
                    </table>
                </div>
            </div>

        </div>
    </div>
    <hr style="height:1px;border-top:1px solid #ccc;"/>

    <div class="row" style="margin-bottom:20px;">
        <div class="col-lg-4 col-sm-4 col-xs-12" id="todo_list" style="padding-right:30px">
            <div class="panel">
                <div class="panel-heading">
                    <h3 class="panel-title">个人待办事宜</h3>
                    <div class="col-sm-12 table-toolbar-right" style="position: absolute; right: 15px;top: 16px;">
                        <a  id="todo_more" class= btn-default" style="cursor:pointer;font-size: 16px">more</a>
                    </div>
                </div>
                <div class="panel-body" id="todo_list_row">
                    <table id="todo_table">
                    </table>
                </div>
            </div>

        </div>


        <div class="col-lg-4 col-sm-4 col-xs-12" id="norecord_list" style="padding-left:15px;padding-right:15px">
            <div class="panel">
                <div class="panel-heading">
                    <h3 class="panel-title">已办未结</h3>
                    <div class="col-sm-12 table-toolbar-right" style="position: absolute; right: 15px;top: 16px;">
                        <a  id="norecord_more" class= btn-default" style="cursor:pointer;font-size: 16px">more</a>
                    </div>
                </div>
                <div class="panel-body" id="norecord_list_row">
                    <table id="norecord_table">
                    </table>
                </div>
            </div>

        </div>

        <div class="col-lg-4 col-sm-4 col-xs-12" id="record_list" style="padding-left:30px">
            <div class="panel">
                <div class="panel-heading">
                    <h3 class="panel-title">已办已结</h3>
                    <div class="col-sm-12 table-toolbar-right" style="position: absolute; right: 15px;top: 16px;">
                        <a id="record_more" class= btn-default" style="cursor:pointer;font-size: 16px">more</a>
                    </div>
                </div>
                <div class="panel-body" id="record_list_row">
                    <table id="record_table">
                    </table>
                </div>
            </div>
        </div>
    </div>
<!--
    <div class="row">
        <div class="col-lg-12" id="page-worklogs">
        </div>
    </div>
    <div class="row">
        <div class="col-lg-12" id="page-calendar">
        </div>
    </div>
    -->
</div>
<script>
    $(function(){

        //menu/user/worklogs
    //    var url02 = 'menu/user/worklogs';
     //   loadURL(url02,$("#page-worklogs"));

     //   var url03 = 'menu/daily/schedules';
      //  loadURL(url03,$("#page-calendar"));


    })
    $(function(){
        load_notice();
        load_remind();
        load_todo();
        load_norecord();
        load_record();
        $('#page-content').on("click",'#notice_more',function(){
            loadURL("menu/com/noticeTest?viewtype=2",$('#content-container'));
        });
        $('#page-content').on("click",'#remind_more',function(){
            loadURL("menu/remind",$('#content-container'));
        });
        $('#page-content').on("click",'#todo_more',function(){
            loadURL("menu/toDo",$('#content-container'));
        });
        $('#page-content').on("click",'#norecord_more',function(){
            loadURL("menu/taskRecord?type=1",$('#content-container'));
        });
        $('#page-content').on("click",'#record_more',function(){
            loadURL("menu/taskRecord?type=2",$('#content-container'));
        });
    })


    //公告通知
    function load_notice(){
        jQuery("#notice_table").jqGrid({
            url:'<%=path%>/com/noticeTest/list?viewtype=2',
            datatype: "json",
            colNames:['公告主题',"id"],
            colModel:[
                {name:'topic',index:'topic', width:200,search:false,sortable:false},
                {name:'id',index:'id',search:false,hidden:true,key:true}
            ],
            rowNum :5,
            // rowList:[10,20,30],
            //  pager : '#notice_list_page',
            sortname : '',
            sortorder : "",
            gridComplete:function(){
                $('#gview_notice_table a.ui-jqgrid-titlebar-close').hide();
                $('#gview_notice_table span.ui-jqgrid-title more').remove();
                $('#gview_notice_table span.ui-jqgrid-title').append('<more>More</more>') ;
                $(".ui-jqgrid-bdiv").css("overflow-x","hidden");
            },
            onSelectRow: function (rowId, status, e) {
                var rowId = $("#notice_table").jqGrid('getGridParam','selrow');
                var rowDatas = $("#notice_table").jqGrid('getRowData', rowId);
            },
            ondblClickRow:function(rowid, iRow, iCol, e){
                var rowId = $("#notice_table").jqGrid('getGridParam','selrow');
                var rowDatas = $("#notice_table").jqGrid('getRowData', rowId);
                if(rowId !="")
                loadURL('<%=path%>/com/noticeTest/read?keyId='+rowId+'&viewtype=2&index=1', $('#page-content'));
            },
            jsonReader: {
                root: "dataRows",
                page: "page",
                total: "total",
                records: "records",
                repeatitems : false
            },
         //   caption : "公告通知",
            multiselect : false,
            rownumbers:false,
            gridview:true,
            shrinkToFit:true,
            viewrecords: false,
            autowidth: true,
            height:'auto',
            forceFit:true,
            loadComplete: function() {
            }
        });
        $(window).on('resize.jqGrid', function() {
            jQuery("#notice_table").jqGrid('setGridWidth', $("#notice_list_row").width());
        })
        jQuery("#notice_table").jqGrid('filterToolbar',{searchOperators:false,stringResult:true});


    };

    //提醒事项
    function load_remind(){
        jQuery("#remind_table").jqGrid({
            url:'<%=path%>/main/remind/list',
            datatype: "json",
            colNames:['提醒内容',"id",'url'],
            colModel:[
                {name:'content',index:'content', width:200,search:false,sortable:false},
                {name:'id',index:'id',search:false,hidden:true,key:true},
                {name:'url',index:'url',search:false,hidden:true}
            ],
            rowNum :5,
            // rowList:[10,20,30],
            //  pager : '#notice_list_page',
            sortname : '',
            sortorder : "",
            gridComplete:function(){
                $('#gview_remind_table a.ui-jqgrid-titlebar-close').hide();
                $('#gview_remind_table span.ui-jqgrid-title more').remove();
                $('#gview_remind_table span.ui-jqgrid-title').append('<more>More</more>') ;
                $(".ui-jqgrid-bdiv").css("overflow-x","hidden");
            },
            onSelectRow: function (rowId, status, e) {
                var rowId = $("#remind_table").jqGrid('getGridParam','selrow');
                var rowDatas = $("#remind_table").jqGrid('getRowData', rowId);
            },
            ondblClickRow:function(rowid, iRow, iCol, e){
                var rowId = $("#remind_table").jqGrid('getGridParam','selrow');
                var rowDatas = $("#remind_table").jqGrid('getRowData', rowId);
                if(rowId !="")
                    loadURL(rowDatas.url+"&index=1",$('#page-content'));
            },
            jsonReader: {
                root: "dataRows",
                page: "page",
                total: "total",
                records: "records",
                repeatitems : false
            },
          //  caption : "提醒事项",
            multiselect : false,
            rownumbers:false,
            gridview:true,
            shrinkToFit:true,
            viewrecords: false,
            autowidth: true,
            height:'auto',
            forceFit:true,
            loadComplete: function() {
            }
        });
        $(window).on('resize.jqGrid', function() {
            jQuery("#remind_table").jqGrid('setGridWidth', $("#remind_list_row").width());
        })
        jQuery("#remind_table").jqGrid('filterToolbar',{searchOperators:false,stringResult:true});


    };

    //个人待办事项目
    function load_todo(){
        jQuery("#todo_table").jqGrid({
            url:'../main/taskRecord/toDoList',
            datatype: "json",
            colNames:['审核内容','所属模块','申请人','上一步操作人','时间','url',"id"],
            colModel:[
                {name:'pname',index:'pname', width:100,search:false,sortable:false},
                {name:'module',index:'module', width:60,search:false,sortable:false},
                {name:'creater',index:'creater', width:60,search:false,sortable:false},
                {name:'toUser',index:'toUser', width:80,search:false,sortable:false},
                {name:'time',index:'time', width:100,search:false,sortable:false},
                {name:'url',index:'url', width:0,search:false,sortable:false,hidden:true},
                {name:'docId',index:'docId',search:false,hidden:true,key:true}
            ],
            rowNum :5,
            // rowList:[10,20,30],
            //  pager : '#notice_list_page',
            sortname : '',
            sortorder : "",
            gridComplete:function(){
                $('#gview_todo_table a.ui-jqgrid-titlebar-close').hide();
                $('#gview_todo_table span.ui-jqgrid-title more').remove();
                $('#gview_todo_table span.ui-jqgrid-title').append('<more>More</more>') ;
                $(".ui-jqgrid-bdiv").css("overflow-x","hidden");

            },
            onSelectRow: function (rowId, status, e) {
                var rowId = $("#todo_table").jqGrid('getGridParam','selrow');
                var rowDatas = $("#todo_table").jqGrid('getRowData', rowId);
            },
            ondblClickRow:function(rowid, iRow, iCol, e){
                var rowId = $("#todo_table").jqGrid('getGridParam','selrow');
                var rowDatas = $("#todo_table").jqGrid('getRowData', rowId);
                if(rowId !="")
                    loadURL(rowDatas.url+"&index=1",$('#page-content'));
            },
            jsonReader: {
                root: "dataRows",
                page: "page",
                total: "total",
                records: "records",
                repeatitems : false
            },
          //  caption : "个人待办事项",
            multiselect : false,
            rownumbers:false,
            gridview:true,
            shrinkToFit:true,
            viewrecords: false,
            autowidth: true,
            height:'auto',
            forceFit:true,
            loadComplete: function() {
            }
        });
        $(window).on('resize.jqGrid', function() {
            jQuery("#todo_table").jqGrid('setGridWidth', $("#todo_list_row").width());
        })
        jQuery("#todo_table").jqGrid('filterToolbar',{searchOperators:false,stringResult:true});


    };


    //已办未结
    function load_norecord(){
        jQuery("#norecord_table").jqGrid({
            url:'<%=path%>/main/taskRecord/list?type=1',
            datatype: "json",
            colNames:['审核内容','所属模块','申请人','当前操作人','url',"id"],
            colModel:[
                {name:'pname',index:'pname', width:100,search:false,sortable:false},
                {name:'module',index:'module', width:60,search:false,sortable:false},
                {name:'creater',index:'creater', width:60,search:false,sortable:false},
                {name:'usernames',index:'usernames', width:100,search:false,sortable:false},
                {name:'url',index:'url', width:0,search:false,sortable:false,hidden:true},
                {name:'id',index:'id',search:false,hidden:true,key:true}
            ],
            rowNum :5,
            // rowList:[10,20,30],
            //  pager : '#notice_list_page',
            sortname : '',
            sortorder : "",
            gridComplete:function(){
                $('#gview_norecord_table a.ui-jqgrid-titlebar-close').hide();
                $('#gview_norecord_table span.ui-jqgrid-title more').remove();
                $('#gview_norecord_table span.ui-jqgrid-title').append('<more>More</more>') ;
                $(".ui-jqgrid-bdiv").css("overflow-x","hidden");

            },
            onSelectRow: function (rowId, status, e) {
                var rowId = $("#norecord_table").jqGrid('getGridParam','selrow');
                var rowDatas = $("#norecord_table").jqGrid('getRowData', rowId);
            },
            ondblClickRow:function(rowid, iRow, iCol, e){
                var rowId = $("#norecord_table").jqGrid('getGridParam','selrow');
                var rowDatas = $("#norecord_table").jqGrid('getRowData', rowId);
                if(rowId !="")
                    loadURL(rowDatas.url+"&index=1",$('#page-content'));
            },
            jsonReader: {
                root: "dataRows",
                page: "page",
                total: "total",
                records: "records",
                repeatitems : false
            },
          //  caption : "已办未结",
            multiselect : false,
            rownumbers:false,
            gridview:true,
            shrinkToFit:true,
            viewrecords: false,
            autowidth: true,
            height:'auto',
            forceFit:true,
            loadComplete: function() {
            }
        });
        $(window).on('resize.jqGrid', function() {
            jQuery("#norecord_table").jqGrid('setGridWidth', $("#norecord_list_row").width());
        })
        jQuery("#norecord_table").jqGrid('filterToolbar',{searchOperators:false,stringResult:true});


    };

    //已办已结
    function load_record(){
        jQuery("#record_table").jqGrid({
            url:'<%=path%>/main/taskRecord/list?type=2',
            datatype: "json",
            colNames:['审核内容','所属模块','url',"id"],
            colModel:[
                {name:'pname',index:'pname', width:200,search:false,sortable:false},
                {name:'module',index:'module', width:100,search:false,sortable:false},
                {name:'url',index:'url', width:0,search:false,sortable:false,hidden:true},
                {name:'id',index:'id',search:false,hidden:true,key:true}
            ],
            rowNum :5,
            // rowList:[10,20,30],
            //  pager : '#notice_list_page',
            sortname : '',
            sortorder : "",
            gridComplete:function(){
                $('#gview_record_table a.ui-jqgrid-titlebar-close').hide();
                $('#gview_record_table span.ui-jqgrid-title more').remove();
                $('#gview_record_table span.ui-jqgrid-title').append('<more>More</more>') ;
                $(".ui-jqgrid-bdiv").css("overflow-x","hidden");

            },
            onSelectRow: function (rowId, status, e) {
                var rowId = $("#record_table").jqGrid('getGridParam','selrow');
                var rowDatas = $("#record_table").jqGrid('getRowData', rowId);
            },
            ondblClickRow:function(rowid, iRow, iCol, e){
                var rowId = $("#record_table").jqGrid('getGridParam','selrow');
                var rowDatas = $("#record_table").jqGrid('getRowData', rowId);
                if(rowId !="")
                loadURL(rowDatas.url+"&index=1",$('#page-content'));
            },
            jsonReader: {
                root: "dataRows",
                page: "page",
                total: "total",
                records: "records",
                repeatitems : false
            },
         //   caption : "已办已结",
            multiselect : false,
            rownumbers:false,
            gridview:true,
            shrinkToFit:true,
            viewrecords: false,
            autowidth: true,
            height:'auto',
            forceFit:true,
            loadComplete: function() {
            }
        });
        $(window).on('resize.jqGrid', function() {
            jQuery("#record_table").jqGrid('setGridWidth', $("#record_list_row").width());
        })
        jQuery("#record_table").jqGrid('filterToolbar',{searchOperators:false,stringResult:true});


    };
</script>
